import axiosInstance from "./axios";

const API_URL = '/config/cdn/node';

export const getNodes = async () => {
  const res = await axiosInstance.get(`${API_URL}/cdn_nodes`);
  return res.data;
};

export const createNode = async (data: any) => {
  const res = await axiosInstance.post(`${API_URL}/cdn_nodes`, data);
  return res.data;
};

export const updateNode = async (id: number, data: any) => {
  const res = await axiosInstance.put(`${API_URL}/cdn_nodes/${id}`, data);
  return res.data;
};

export const deleteNode = async (id: number) => {
  const res = await axiosInstance.delete(`${API_URL}/cdn_nodes/${id}`);
  return res.data;
};